// HSS.Logging.Management.OptionsPanel.cs
// ----------------------------------------------------------------------------
// Licensed under the MIT license
// http://www.opensource.org/licenses/mit-license.html
// ----------------------------------------------------------------------------
// HighSpeed-Solutions, LLC
// Copyright (c) 2001-2010
// ----------------------------------------------------------------------------
// File:       OptionsPanel.cs
// Author:     HSS\gbanta
// Created:    08/12/2010
// Modified:   12/04/2010
// ----------------------------------------------------------------------------
namespace HSS.Logging.Management
{
	#region Using Directives
	using System;
	using System.ComponentModel;
	using System.Drawing;
	using System.Windows.Forms;
	using HSS.Forms;
	#endregion


	internal sealed class OptionsPanel : WizardPanel
	{
		private Label _descriptionLabel;
		private Label _labelFeatures;
		private Label _labelNote;
		private Label _labelUninstall;
		private RadioButton _radioFeatures;
		private RadioButton _radioUninstall;
		private TableLayoutPanel overarchingTableLayoutPanel;

		public OptionsPanel()
		{
			this.InitializeComponent();
			base.Caption = HSS.Logging.Management.Resources.Options_Caption;
			if (InstallWizard.Action == WizardAction.AddAllFeatures)
			{
				this._radioFeatures.Checked = true;
				this._radioUninstall.Checked = false;
			}
			if (InstallWizard.Action == WizardAction.RemoveAllFeatures)
			{
				this._radioFeatures.Checked = false;
				this._radioUninstall.Checked = true;
			}
		}

		private void InitializeComponent()
		{
			ComponentResourceManager manager = new ComponentResourceManager(typeof(OptionsPanel));
			this._descriptionLabel = new Label();
			this._labelUninstall = new Label();
			this._radioUninstall = new RadioButton();
			this._labelFeatures = new Label();
			this._radioFeatures = new RadioButton();
			this._labelNote = new Label();
			this.overarchingTableLayoutPanel = new TableLayoutPanel();
			this.overarchingTableLayoutPanel.SuspendLayout();
			base.SuspendLayout();
			manager.ApplyResources(this._descriptionLabel, "_descriptionLabel");
			this._descriptionLabel.AutoSize = false;
			this._descriptionLabel.TabIndex = 0;
			this._descriptionLabel.Location = new Point(0, 0);
			this._descriptionLabel.Margin = new Padding(0, 0, 0, 3);
			this._descriptionLabel.Name = "_descriptionLabel";
			this._descriptionLabel.Size = new Size(0x220, 14);
			manager.ApplyResources(this._labelUninstall, "_labelUninstall");
			this._labelUninstall.Anchor = AnchorStyles.Left;
			this._labelUninstall.AutoSize = false;
			this._labelUninstall.Location = new Point(0x1c, 0x6f);
			this._labelUninstall.Size = new Size(0x204, 0x27);
			this._labelUninstall.TabIndex = 4;
			this._labelUninstall.Margin = new Padding(0x1c, 3, 0, 3);
			this._labelUninstall.Name = "_labelUninstall";
			manager.ApplyResources(this._radioUninstall, "_radioUninstall");
			this._radioUninstall.Anchor = AnchorStyles.Left;
			this._radioUninstall.AutoSize = false;
			this._radioUninstall.Location = new Point(14, 0x58);
			this._radioUninstall.Size = new Size(530, 0x11);
			this._radioUninstall.TabIndex = 3;
			this._radioUninstall.Margin = new Padding(14, 3, 0, 3);
			this._radioUninstall.Name = "_radioUninstall";
			manager.ApplyResources(this._labelFeatures, "_labelFeatures");
			this._labelFeatures.Anchor = AnchorStyles.Left;
			this._labelFeatures.AutoSize = false;
			this._labelFeatures.Location = new Point(0x1c, 0x2b);
			this._labelFeatures.Size = new Size(0x204, 0x27);
			this._labelFeatures.TabIndex = 2;
			this._labelFeatures.Margin = new Padding(0x1c, 3, 0, 3);
			this._labelFeatures.Name = "_labelFeatures";
			manager.ApplyResources(this._radioFeatures, "_radioFeatures");
			this._radioFeatures.Anchor = AnchorStyles.Left;
			this._radioFeatures.AutoSize = false;
			this._radioFeatures.Location = new Point(14, 20);
			this._radioFeatures.Size = new Size(530, 0x11);
			this._radioFeatures.TabIndex = 1;
			this._radioFeatures.Checked = true;
			this._radioFeatures.Margin = new Padding(14, 3, 0, 3);
			this._radioFeatures.Name = "_radioFeatures";
			manager.ApplyResources(this._labelNote, "_labelNote");
			this._labelNote.AutoSize = false;
			this._labelNote.Location = new Point(0, 0xa5);
			this._labelNote.Size = new Size(0x220, 0x5c);
			this._labelNote.TabIndex = 5;
			this._labelNote.Margin = new Padding(0, 3, 0, 0);
			this.overarchingTableLayoutPanel.Anchor = AnchorStyles.Right | AnchorStyles.Left | AnchorStyles.Top;
			this.overarchingTableLayoutPanel.AutoSize = false;
			this.overarchingTableLayoutPanel.ColumnCount = 1;
			this.overarchingTableLayoutPanel.Location = new Point(0, 0);
			this.overarchingTableLayoutPanel.RowCount = 6;
			this.overarchingTableLayoutPanel.Size = new Size(0x220, 0x112);
			this.overarchingTableLayoutPanel.TabIndex = 10;
			this.overarchingTableLayoutPanel.ColumnStyles.Add(new ColumnStyle(SizeType.Absolute, 456f));
			this.overarchingTableLayoutPanel.Controls.Add(this._descriptionLabel, 0, 0);
			this.overarchingTableLayoutPanel.Controls.Add(this._labelNote, 0, 5);
			this.overarchingTableLayoutPanel.Controls.Add(this._labelUninstall, 0, 4);
			this.overarchingTableLayoutPanel.Controls.Add(this._radioUninstall, 0, 3);
			this.overarchingTableLayoutPanel.Controls.Add(this._labelFeatures, 0, 2);
			this.overarchingTableLayoutPanel.Controls.Add(this._radioFeatures, 0, 1);
			this.overarchingTableLayoutPanel.Margin = new Padding(12);
			this.overarchingTableLayoutPanel.Name = "overarchingTableLayoutPanel";
			this.overarchingTableLayoutPanel.RowStyles.Add(new RowStyle());
			this.overarchingTableLayoutPanel.RowStyles.Add(new RowStyle());
			this.overarchingTableLayoutPanel.RowStyles.Add(new RowStyle());
			this.overarchingTableLayoutPanel.RowStyles.Add(new RowStyle());
			this.overarchingTableLayoutPanel.RowStyles.Add(new RowStyle());
			this.overarchingTableLayoutPanel.RowStyles.Add(new RowStyle());
			base.Controls.Add(this.overarchingTableLayoutPanel);
			base.Name = "OptionsPanel";
			manager.ApplyResources(this, "$this");
			this.overarchingTableLayoutPanel.ResumeLayout(false);
			this.overarchingTableLayoutPanel.PerformLayout();
			base.ResumeLayout(false);
			base.PerformLayout();
		}

		public override bool OnNext()
		{
			if (this._radioFeatures.Checked)
			{
				InstallWizard.Action = WizardAction.AddAllFeatures;
			}
			else if (this._radioUninstall.Checked)
			{
				InstallWizard.Action = WizardAction.RemoveAllFeatures;
			}
			return true;
		}
	}
}